package com.javabasic.algorithm.newcode;

import java.util.Scanner;

/**
 * @Author xiongmin
 * @ClassName 字符串旋转
 * @Description TODO
 * @Date 2019/9/1 11:55
 * @Version 1.0
 **/
public class 字符串旋转 {
    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        String str = cin.next();
        String[] split = str.split(";");
        for (int i = 1; i <= split[0].length() - 1; i++) {
//            System.out.println(split[0].substring(i, split[0].length()) + split[0].substring(0, i));
            if ((split[0].substring(i, split[0].length()) + split[0].substring(0,i)).equals(split[1])) {
                System.out.println("true");
                return ;
            }
        }
        System.out.println("false");
    }
}
